package com.beiming.kotlindemo

/**
 * Created by lingchen on 2020/4/30. 16:31
 * mail:lingchen52@foxmail.com
 */
//普通类需加上open关键字才能被继承
//任何一个类只能有一个主构造函数，可以有多个次构造函数
open class Person(val name: String, val age: Int) {

    fun eat() {
        println(name + " is eating. He is " + age + " years old")
    }

}